﻿

namespace Gameplay.CharacterFramework
{
    public abstract class CharacterStatus
    {
        public CharacterData Data { get; set; }

        public Role Role;

        public float MoveSpeed;
        
        private float _hp;
        public float HP 
        {
            get { return _hp; }
            set 
            {
                if (value <= 0)
                {
                    value = 0;
                    Role.Die();
                }
                _hp = value;
            }
        }
        public bool IsMoving { get; set; }
        public bool IsDead { get; set; }
        public bool IsDamage { get; set; }
        public bool IsFalling { get; set; }
        public bool IsUsing { get; set; }

        public virtual void Init() 
        {
            HP = Data.Config.MaxHP;
        }
        public virtual void StateUpdate() { }
    }
}
